#!/bin/sh -
STATUS=100
OK="built"
VPPCALL=$(vppctl show version)
time=0

while [[ !  $VPPCALL =~ $OK  ]]
do
    sleep 1
	let time++
    VPPCALL=$(vppctl show version)
    echo "vpp 无法连接"
	if [ $time -eq 600 ];then
		echo "启动超时 退粗!"
		exit -1 
	fi

done
echo "vpp 可以连接"

while [ $STATUS -eq 100 ]
do
  java -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -Xms1024m -Xmx1024m -Xmn256m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC -jar $(dirname $0)/vpp-integration-distribution-1.19.01-SNAPSHOT.jar
  STATUS=$?
  echo "Honeycomb exited with status: $STATUS"
  if [ $STATUS -eq 100 ]
  then
    echo "Restarting..."
  fi
done
